package com.ruoyi.hospital.service.member.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hospital.mapper.member.MemberInvoiceMapper;
import com.ruoyi.hospital.domain.member.MemberInvoice;
import com.ruoyi.hospital.service.member.IMemberInvoiceService;

/**
 * 发票信息Service业务层处理
 *
 * @author wendao
 * @date 2024-08-15
 */
@Service
public class MemberInvoiceServiceImpl implements IMemberInvoiceService
{
    @Autowired
    private MemberInvoiceMapper memberInvoiceMapper;

    /**
     * 查询发票信息
     *
     * @param id 发票信息主键
     * @return 发票信息
     */
    @Override
    public MemberInvoice selectMemberInvoiceById(Integer id)
    {
        return memberInvoiceMapper.selectMemberInvoiceById(id);
    }

    /**
     * 查询发票信息列表
     *
     * @param memberInvoice 发票信息
     * @return 发票信息
     */
    @Override
    public List<MemberInvoice> selectMemberInvoiceList(MemberInvoice memberInvoice)
    {
        return memberInvoiceMapper.selectMemberInvoiceList(memberInvoice);
    }

    /**
     * 新增发票信息
     *
     * @param memberInvoice 发票信息
     * @return 结果
     */
    @Override
    public int insertMemberInvoice(MemberInvoice memberInvoice)
    {
        memberInvoice.setCreateTime(DateUtils.getNowTimeSecond());
        return memberInvoiceMapper.insertMemberInvoice(memberInvoice);
    }

    /**
     * 修改发票信息
     *
     * @param memberInvoice 发票信息
     * @return 结果
     */
    @Override
    public int updateMemberInvoice(MemberInvoice memberInvoice)
    {
        memberInvoice.setUpdateTime(DateUtils.getNowTimeSecond());
        return memberInvoiceMapper.updateMemberInvoice(memberInvoice);
    }

    /**
     * 批量删除发票信息
     *
     * @param ids 需要删除的发票信息主键
     * @return 结果
     */
    @Override
    public int deleteMemberInvoiceByIds(Integer[] ids)
    {
        return memberInvoiceMapper.deleteMemberInvoiceByIds(ids);
    }

    /**
     * 删除发票信息信息
     *
     * @param id 发票信息主键
     * @return 结果
     */
    @Override
    public int deleteMemberInvoiceById(Integer id)
    {
        return memberInvoiceMapper.deleteMemberInvoiceById(id);
    }
}
